<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<title>分类编辑器 -- Powered by CentIMS {$core_version}</title>
		<link href="{'bootstrap/css/bootstrap.css'|shared}" rel="stylesheet"/>
		<link href="{'bootstrap/css/bootstrap-responsive.css'|shared}" rel="stylesheet"/>
		<link href="{'plugins/ztree/ztree.css'|jquery}" rel="stylesheet"/>
		<link href="{'common.css'|shared}" rel="stylesheet"/>		
	</head>
	<body>
		<div class="workspace">
			<ul class="nav nav-tabs">
				<li>&nbsp;&nbsp;</li>	
			    <li><a href="./?Ctlr=Category"><i class="icon-folder-open"></i>分类管理</a></li>
			    <li class="active"><a href="#"><i class="icon-plus"></i>新增分类</a></li>
		    </ul>
		    {if $page_tip_info}
		    <div class="alert {$alert_cls}">
		        <button class="close" data-dismiss="alert">×</button>
		        {$page_tip_info}
	      	</div>
	      	{/if}
		</div>
		<div>			
			<form class="form-horizontal" id="category-form" method="POST" action="./?Ctlr=SaveCategory">
				<input type="hidden" name="cid" id="cid" value="{$cid}"/>
	        	<fieldset>
	        		<div class="control-group">
	          			<label class="control-label" for="up_name">上级分类</label>
	            		<div class="controls">
	            			<div class="input-append">
	            				<input type="hidden" id="up_cid" name="up_cid" value="{$up_cid}"/>
	              				<input type="text" id="up_name" name="up_name" value="{$up_name}" readonly="readonly"/><button id="btn-cate-select" class="btn" type="button">选择..</button>
	              			</div>
	            		</div>
	          		</div>  
	          		
	          		<div class="control-group {$error_cls.type}">
	          			<label class="control-label" for="type">分类类型</label>
	            		<div class="controls">
	              			{html_options name=type options=$cate_types selected=$type}
	              			<span class="help-inline">{$error.type}</span>
	            		</div>
	          		</div>
	          		 		
	          		<div class="control-group {$error_cls.title}">
	          			<label class="control-label" for="title">分类名称</label>
	            		<div class="controls">
	              			<input type="text" id="title" name="title" value="{$title}">
	              			<span class="help-inline">{$error.title}</span>
	            		</div>
	          		</div>          
	          		
	          		<div class="control-group {$error_cls.name}">
	            		<label class="control-label" for="name">模板引用名</label>
	            		<div class="controls">
	              			<input type="text" id="name" name="name" value="{$name}">
	              			<span class="help-inline">{$error.name}</span>
	            		</div>
	          		</div>
	          		
	          		<div class="control-group {$error_cls.bind}">
	            		<label class="control-label" for="bind">绑定二级域名</label>
	            		<div class="controls">
	              			<input type="text" id="bind" name="bind" value="{$bind}">
	              			<span class="help-inline"><label class="checkbox inline"><input type="checkbox" name="home" {$home|checked:1}/>二级域名首页</label></span>
	            		</div>
	          		</div>
	          		
	          		<div class="control-group">
	            		<label class="control-label" for="display">导航显示</label>
	            		<div class="controls">
	            			<label class="radio inline" for="display">
	              				<input type="radio" id="display" name="display" value="1" {'1'|checked:$display}>是
	              			</label>
	              			<label class="radio inline" for="display1">
	              				<input type="radio" id="display1" name="display" value="0" {'0'|checked:$display}>否 
	              			</label>      			
	            		</div>
	          		</div>	          		
	          		<div class="control-group {$error_cls.url_path}">
	            		<label class="control-label" for="url_path">默认URL目录</label>
	            		<div class="controls">
	              			<input type="text" name="url_path" id="url_path" value="{$url_path}"/>
	              			<span class="help-inline">{$error.url_path}</span>
	            		</div>
	          		</div>
	          		<div class="control-group {$error_cls.url_pattern}">
	            		<label class="control-label" for="url_pattern">默认URL生成规则</label>
	            		<div class="controls">	            		
	              			<input type="text" name="url_pattern" id="url_pattern" value="{$url_pattern}" rel="popover" data-original-title="提示"/>
	              			<span class="help-inline">{$error.url_pattern}</span>
	            		</div>
	          		</div>
	          		<div class="control-group">
		            	<label class="control-label" for="note">备注</label>
		            	<div class="controls">
		             		<textarea class="input-xlarge" name="note" id="note" rows="3">{$note}</textarea>
		            	</div>
		          	</div> 	          		          	
		          	<div class="form-actions">
		            	<button type="submit" class="btn btn-primary">保存</button>
		            	{if !$editing}
		            	<button type="submit" name="goon" value="1" class="btn btn-primary">新增并继续</button>
		            	{/if}
		            	<a href="./?Ctlr=Category" class="btn">取消</a>
		          	</div>
	        	</fieldset>
	      	</form>
      	</div>
      	
      	<div class="modal hide" id="cate-tree-modal">
		  	<div class="modal-header">
			    <button class="close" data-dismiss="modal">×</button>
			    <h3>选择上级分类</h3>
		  	</div>
		  	
			<div class="modal-body" style="height:250px;overflow:auto;">
				<ul class="ztree" id="cate-tree"></ul>
			</div>
						  
			<div class="modal-footer">
				<span id="tpl-info" class="label label-warning" style="margin-right:15px;display:none;">请选择模板!</span>
				<a href="#" class="btn" id="btn-close-form">关闭</a>
				<a href="#" class="btn btn-primary" id="btn-done">确定</a>
			</div>
		</div>
      	
      	
		<script type="text/javascript" src="{'jquery-1.7.1.js'|jquery}"></script>
		<script type="text/javascript" src="{'bootstrap/bootstrap.js'|shared}"></script>
		<script type="text/javascript" src="{'plugins/jquery.validate.js'|jquery}"></script>
		<script type="text/javascript" src="{'plugins/ztree/ztree.js'|jquery}"></script>
		<script type="text/javascript">
			var treeNodes = {$treeNodes};
		</script>		
		<script type="text/javascript" src="category_form.js"></script>		
	</body>
</html>
